package it.bambo.tankwars.model;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * Andreas Baumgartner: andreas@bambo.it
 */
public class Unit {

    protected BattleField battleField;

    protected Rectangle defaultRect;
    protected Rectangle rect;

    protected BufferedImage image;

    protected ControlType controlType;

    public Unit(BattleField battleField, Rectangle defaultRect) {
        this.defaultRect = defaultRect;
        this.battleField = battleField;
        battleField.getUnits().add(this);

        rect = new Rectangle(defaultRect.x, defaultRect.y,
                (int) (defaultRect.getWidth() * battleField.getSizeFactor()),
                (int) (defaultRect.getHeight() * battleField.getSizeFactor()));
    }

    public void executeCommand(Command command) {
    }

    public Rectangle getRect() {
        return rect;
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public ControlType getControlType() {
        return controlType;
    }

    public void setControlType(ControlType controlType) {
        this.controlType = controlType;
    }

}
